<template>
  <div class="layout layout-100">
    <Layout class="layout-100 modal">
      <Header class="header-cont">{{ this.$route.params.name }}</Header>
      <Content class="content-cont  modal-content">
        <Tabs value="0" @on-click="">
          <TabPane label="风险信息" name="0">
            <Form label-position="top">
              <Row>
                <Col span="12">
                  <FormItem label="公司名称">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.orgName"
                      :title="detailData.orgName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="所属区域">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.regionName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="项目名称">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.proName"
                      :title="detailData.proName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="工点名称">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.constructionPointName"
                      :title="detailData.constructionPointName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="工点风险等级">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.constructionPointRiskLevelName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="起始时间">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.begin"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="结束时间">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.end"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="当月是否作业">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.isDestroy"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="工点描述">
                    <Input
                      style="width:80%;"
                      type="textarea"
                      v-model.trim="detailData.constructionPointDescription"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="作业风险名称">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.riskOperationName"
                      :title="detailData.riskOperationName"
                      class="width50"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="作业风险类型">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.riskCategoryName"
                      :title="detailData.riskCategoryName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="作业风险等级">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.riskLevelName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="分级方法">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.classficationMethodName"
                      :title="detailData.classficationMethodName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="具体风险描述">
                    <Input
                      style="width:80%;"
                      type="textarea"
                      v-model.trim="detailData.riskDescription"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="工程公司管控要求">
                    <Input
                      style="width:80%;"
                      type="textarea"
                      v-model.trim="
                        detailData.engineeringCompanyRegulatoryRequirements
                      "
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="集团公司管控要求">
                    <Input
                      style="width:80%;"
                      type="textarea"
                      v-model.trim="
                        detailData.groupCompanyRegulatoryRequirements
                      "
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="目前该风险安全控制情况">
                    <Input
                      style="width:80%;"
                      type="textarea"
                      v-model.trim="detailData.currentSaftyControlOfTheRisk"
                      readonly
                    />
                  </FormItem>
                </Col>
              </Row>
            </Form>
          </TabPane>
          <TabPane label="管控措施" name="1">
            <Form label-position="top">
              <Row>
                <Col span="12">
                  <FormItem label="管控措施">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.controlMeasures"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="12">
                  <FormItem label="管控类型">
                    <Input
                      style="width:350px;"
                      v-model.trim="detailData.measureTypeName"
                      readonly
                    />
                  </FormItem>
                </Col>
                <!-- <Col span="12">
								<FormItem label="频次">
									<Input style="width:350px;" v-model.trim="detailData.proName" readonly />
								</FormItem>
								</Col> -->
                <Col span="24">
                  <FormItem label="项目管控责任人">
                    <Input
                      style="width:80%;"
                      type="textarea"
                      v-model.trim="projectPerson"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="项目部分管领导">
                    <Input
                      style="width:80%;"
                      v-model.trim="projectLeader"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="项目部主管领导">
                    <Input
                      style="width:80%;"
                      v-model.trim="projectMainLeader"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="工程公司管理人员">
                    <Input
                      style="width:80%;"
                      v-model.trim="engineeringCompanyPerson"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="工程公司分管领导">
                    <Input
                      style="width:80%;"
                      v-model.trim="engineeringCompanyLeader"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="集团公司管理人员">
                    <Input
                      style="width:80%;"
                      v-model.trim="groupCompanPerson"
                      readonly
                    />
                  </FormItem>
                </Col>
                <Col span="24">
                  <FormItem label="集团公司分管领导">
                    <Input
                      style="width:80%;"
                      v-model.trim="groupCompanLeader"
                      class="width50"
                      readonly
                    />
                  </FormItem>
                </Col>
              </Row>
            </Form>
          </TabPane>
        </Tabs>
      </Content>
    </Layout>
  </div>
</template>

<script>
import { formatDate } from '@/libs/tools'
import { mapMutations } from 'vuex'
export default {
  name: 'dynamic-control-ledger-detail',
  data() {
    return {
      detailData: '',
      projectPerson: '',
      projectLeader: '',
      projectMainLeader: '',
      engineeringCompanyPerson: '',
      engineeringCompanyLeader: '',
      groupCompanPerson: '',
      groupCompanLeader: ''
    }
  },
  methods: {
    getRiskOrderDestroydetail() {
      //信息详情
      this.$api.ledgerQuery
        .getDynamicControlDetail(this.$route.params.id)
        .then(res => {
          if (res.code === 200) {
            this.detailData = res.data
            this.detailData.begin = formatDate(
              this.detailData.begin,
              'yyyy-MM-dd'
            )
            this.detailData.end = formatDate(this.detailData.end, 'yyyy-MM-dd')
            if (res.data.projectDepartmentControllerName) {
              this.projectPerson =
                // res.data.projectDepartmentControllerDept +
                res.data.projectDepartmentControllerPost +
                ':' +
                res.data.projectDepartmentControllerName +
                '(' +
                res.data.projectDepartmentControllerPhone +
                ')'
            }
            if (res.data.projectDepartmentDeputyLeaderName) {
              this.projectLeader =
                // res.data.projectDepartmentDeputyLeaderDept +
                res.data.projectDepartmentDeputyLeaderPost +
                ':' +
                res.data.projectDepartmentDeputyLeaderName +
                '(' +
                res.data.projectDepartmentDeputyLeaderPhone +
                ')'
            }
            if (res.data.projectDepartmentLeaderName) {
              this.projectMainLeader =
                // res.data.projectDepartmentLeaderDept +
                res.data.projectDepartmentLeaderPost +
                ':' +
                res.data.projectDepartmentLeaderName +
                '(' +
                res.data.projectDepartmentLeaderPhone +
                ')'
            }
            if (res.data.engineeringCompanyControllerName) {
              this.engineeringCompanyPerson =
                // res.data.engineeringCompanyControllerDept +
                res.data.engineeringCompanyControllerPost +
                ':' +
                res.data.engineeringCompanyControllerName +
                '(' +
                res.data.engineeringCompanyControllerPhone +
                ')'
            }
            if (res.data.engineeringCompanyDeputyLeaderDept) {
              this.engineeringCompanyLeader =
                // res.data.engineeringCompanyDeputyLeaderDept +
                res.data.engineeringCompanyDeputyLeaderPost +
                ':' +
                res.data.engineeringCompanyDeputyLeaderName +
                '(' +
                res.data.engineeringCompanyDeputyLeaderPhone +
                ')'
            }
            if (res.data.groupCompanyControllerDept) {
              this.groupCompanPerson =
                // res.data.groupCompanyControllerDept +
                res.data.groupCompanyControllerPost +
                ':' +
                res.data.groupCompanyControllerName +
                '(' +
                res.data.groupCompanyControllerPhone +
                ')'
            }
            if (res.data.groupCompanyDeputyLeaderName) {
              this.groupCompanLeader =
                // res.data.groupCompanyDeputyLeaderDept +
                res.data.groupCompanyDeputyLeaderPost +
                ':' +
                res.data.groupCompanyDeputyLeaderName +
                '(' +
                res.data.groupCompanyDeputyLeaderPhone +
                ')'
            }
          } else {
            this.$Message.warning(res.message)
          }
        })
    }
  },
  mounted() {
    this.getRiskOrderDestroydetail()
  }
}
</script>

<style scoped>
.width50 {
  width: 40%;
}
</style>
